//
//  MZChangeRateView.m
//  MZSystem
//
//  Created by Beyondream on 2018/11/9.
//  Copyright © 2018 zerod. All rights reserved.
//

#import "MZChangeRateView.h"

@interface MZChangeRateView()
@property (weak, nonatomic) IBOutlet UIView *contetView;
@property (weak, nonatomic) IBOutlet UISlider *sider;
@property (weak, nonatomic) IBOutlet UILabel *showValuelabel;

@end

@implementation MZChangeRateView
- (void)awakeFromNib {
    [super awakeFromNib];
    self.contetView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
    [self.sider addTarget:self action:@selector(sliderValue:) forControlEvents:UIControlEventValueChanged];
    [self.sider setThumbImage:[UIImage imageNamed:@"播放器-进度条-播放头"] forState:UIControlStateNormal];
}

- (void)sliderValue:(UISlider *)slider {
    self.showValuelabel.text = [NSString stringWithFormat:@"%.0f",1500 + 2500 * slider.value];
    CGFloat minx = 35 + slider.width *slider.value ;
    self.showValuelabel.frame = CGRectMake(minx,CGRectGetMinY(self.showValuelabel.frame), self.showValuelabel.width, self.showValuelabel.height);
    if (self.mzRateBlock) {
        self.mzRateBlock([self.showValuelabel.text integerValue]);
    }
}


@end
